$OpenBSD: patch-poller-wrapper_py,v 1.10 2017/05/30 21:05:44 sthen Exp $

Index: poller-wrapper.py
--- poller-wrapper.py.orig
+++ poller-wrapper.py
@@ -53,7 +53,7 @@ config_file = ob_install_dir + '/config.php'
 
 
 def get_config_data():
-    config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % ob_install_dir]
+    config_cmd = ['%PHP%', '%s/config_to_json.php' % ob_install_dir]
     try:
         proc = subprocess.Popen(config_cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
     except:
@@ -74,7 +74,7 @@ except:
     print "ERROR: Could not load or parse configuration, are PATHs correct?"
     sys.exit(2)
 
-poller_path = config['install_dir'] + '/poller.php'
+poller_path = ob_install_dir + '/poller.php'
 db_username = config['db_user']
 db_password = config['db_pass']
 db_port = int(config['db_port'])
@@ -296,7 +296,7 @@ def poll_worker():
 # EOC5
             try:
                 start_time = time.time()
-                command = "/usr/bin/env php %s -h %s >> /dev/null 2>&1" % (poller_path, device_id)
+                command = "%PHP% %s -h %s >> /dev/null 2>&1" % (poller_path, device_id)
                 subprocess.check_call(command, shell=True)
                 elapsed_time = int(time.time() - start_time)
                 print_queue.put([threading.current_thread().name, device_id, elapsed_time])
